package org.huzhp.security.wx;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description 微信获取用户信息
 * @Author huzp
 * @Data 2019/3/28
 * @Version 1.0
 */

public class WxUserDetailService {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    private static String WX_OPENID = "unionid";


    private String accessTokenUri;


    public WxUserDetailService(WxAuthProperties properties) {
        if (properties.isEnable()) {
            this.accessTokenUri = properties.getAccessTokenUri().replace("APPID", properties.getOpenId()).replace("SECRET", properties.getOpenSecret());
        }
    }


    public Object getUserByCode(String code) {

        return null;
    }

    public UserDetails getUserByExtend(Object user) {
        //微信无其他可用的拓展信息
        return null;
    }

    public Map getUserById(Object user) {

        return null;
    }

    public Map saveUser(Object user) {


        Map userMap = new HashMap(2);

        return userMap;
    }

    public void bindUser(UserDetails myUserDetails, Object user) {

    }

    public void unBindUser(String code) {
    }


}
